﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Degree_MVP
{
    public partial class Form1 : Form, IView
    {
        public Form1()
        {
            InitializeComponent();
        }

        public void SetFarenheit(double value)
        {
            _farenheitBox.Text = value.ToString();
        }

        public void SetCelsius(double value)
        {
            _celsiusBox.Text = value.ToString();
        }

        public double InputDegree
        {
            get { return Convert.ToDouble(_inputBox.Text); }
        }

        private void _celsiusbutton_Click(object sender, EventArgs e)
        {
            if (CelsiusSetted != null)
                CelsiusSetted(this, EventArgs.Empty);
        }

        private void _farenheitbutton_Click(object sender, EventArgs e)
        {
            if (FarenheitSetted != null)
                FarenheitSetted(this, EventArgs.Empty);
        }

        public event EventHandler<EventArgs> CelsiusSetted;
        public event EventHandler<EventArgs> FarenheitSetted;

    }
}
